package com._520it.crm.mapper;

import com._520it.crm.domain.OrderBill;
import com._520it.crm.page.PageResult;
import com._520it.crm.query.OrderBillQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderBillMapper {

    int insert(OrderBill record);

    OrderBill selectByPrimaryKey(Long id);

    List<OrderBill> selectAll();

    int updateByPrimaryKey(OrderBill record);

    List<Map> queryDataList(OrderBillQueryObject qo);

    Long queryForCount(OrderBillQueryObject qo);

    void saveData1(OrderBill ob);

    Long selectForCount(OrderBillQueryObject qo);

    List<Map> selectForList(OrderBillQueryObject qo);

    int updateStatusById(OrderBill orderBill);


    /*
        更改OrderBill状态:
        orderBillId :  保单ID
        orderBillStatus :  修改后保单的状态 : 未提交 0 unsubmit, 待审核 1 preUnderwriting, 提交上级审核 2 superUnderwriting,
                                            待批改 3 preRevise, 待缴费 4 prePayment, 已缴费 5  ,已作废 6 expired, 批改待审核 7
    */
    void updateStatus(@Param("orderBillId") Long orderBillId, @Param("orderBillStatus") int orderBillStatus);

    void updateData(OrderBill ob);

    OrderBill selectPremiumByBillId(Long id);

    void updateStatusByPay(OrderBill orderBill);

    void issueSendBackUpdate(Long orderBillId);

    void updateById(@Param("orderBillId") Long orderBillId,@Param("status")int preunderWriting);

    OrderBill selectById(Long id);

    void removeById(@Param("orderBillId") Long orderBillId,@Param("remove") int remove, @Param("status") int status);

    void updateOrderBill(OrderBill ob);

    void updateTime(OrderBill ob);
}